﻿namespace Wicresoft.Busi.Entity
{
    using System;
    using System.Configuration;
    using Wicresoft.Framework.Organization;

    public class VehicleRoles
    {
        private static Guid _apply = Guid.Empty;
        private static Guid _approve = Guid.Empty;
        private static Guid _check = Guid.Empty;
        private static Guid _expense = Guid.Empty;
        private static Guid _manage = Guid.Empty;
        private static Guid _register = Guid.Empty;

        // Properties
        public static Guid Apply
        {
            get
            {
                if (_apply == Guid.Empty) _apply = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleApply", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _apply;
            }
        }

        public static Guid Approve
        {
            get
            {
                if (_approve == Guid.Empty) _approve = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleApprove", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _approve;
            }
        }

        public static Guid Check
        {
            get
            {
                if (_check == Guid.Empty) _check = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleCheck", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _check;
            }
        }

        public static Guid Expense
        {
            get
            {
                if (_expense == Guid.Empty) _expense = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleExpense", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _expense;
            }
        }

        public static Guid Manage
        {
            get
            {
                if (_manage == Guid.Empty) _manage = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleManage", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _manage;
            }
        }

        public static Guid Register
        {
            get
            {
                if (_register == Guid.Empty) _register = OrganizationPublicHelper.GetRoleInfo("Busi.VehicleUseRegi", new Guid(ConfigurationManager.AppSettings["WSAF.ApplicationID"])).ID;
                return _register;
            }
        }

    }
}

